import 'dart:ffi';

import 'package:flutter_nb_net/flutter_net.dart';

class GlobalConfigResp extends BaseNetModel {
  int? code;
  String? msg;
  GlobalConfigData? data;

  GlobalConfigResp({this.code, this.msg, this.data});

  @override
  fromJson(Map<String, dynamic> json) {
    return GlobalConfigResp(
      code: json['code'],
      msg: json['msg'],
      data: json['data'] == null ? null : GlobalConfigData().fromJson(json['data']),
    );
  }
}

class MapShowResp extends BaseNetModel {
  int? code;
  String? msg;
  bool? data;

  MapShowResp({this.code, this.msg, this.data});

  @override
  fromJson(Map<String, dynamic> json) {
    return MapShowResp(
      code: json['code'],
      msg: json['msg'],
      data: json['data'],
    );
  }
}


class GlobalConfigData extends BaseNetModel {
  bool? autoRefresh;
  int? refreshInterval;

  String? soundAlertTermsOfUse;
  String? soundAlertCommandTip;
  String? soundAlertOpen;
  String? soundAlertClose;

  GlobalConfigData(
      {this.autoRefresh,
      this.refreshInterval,
      this.soundAlertTermsOfUse,
      this.soundAlertCommandTip,
      this.soundAlertOpen,
      this.soundAlertClose});

  GlobalConfigData._()
      : autoRefresh = null,
        refreshInterval = null,
        soundAlertTermsOfUse = null,
        soundAlertCommandTip = null,
        soundAlertOpen = null,
        soundAlertClose = null;

  @override
  fromJson(Map<dynamic, dynamic> json) {
    return GlobalConfigData(
      autoRefresh: json['autoRefresh'],
      refreshInterval: json['refreshInterval'],
      soundAlertTermsOfUse: json['soundAlertTermsOfUse'],
      soundAlertCommandTip: json['soundAlertCommandTip'],
      soundAlertOpen: json['soundAlertOpen'],
      soundAlertClose: json['soundAlertClose'],
    );
  }

  toJson() {
    return {
      'autoRefresh': autoRefresh,
      'refreshInterval': refreshInterval,
      'soundAlertTermsOfUse': soundAlertTermsOfUse,
      'soundAlertCommandTip': soundAlertCommandTip,
      'soundAlertOpen': soundAlertOpen,
      'soundAlertClose': soundAlertClose,
    };
  }
}
